import React, { Component } from 'react'
import Publish from "./utils/index"
import Son from "./compnents/Son"
export class App extends Component {
  state={
    list:[1,2,3],
    flag:false
  }
  btn(){
    console.log( Publish);
    Publish.$emit("son",this.state.list)
    this.setState({flag:!this.state.flag})
  }
  render() {
    return (
      <div>
        App
        <button onClick={this.btn.bind(this)}>点我</button>
        {
          this.state.flag == true ? <Son></Son> :""
        }
        
      </div>
    )
  }
}

export default App
